﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FirstFloor.Documents.Pdf.Fonts
{
    /// <summary>
    /// Defines glyph content in the form of a Unicode string and glyph indices.
    /// </summary>
    internal class GlyphsContent
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="GlyphsContent"/> class.
        /// </summary>
        /// <param name="indices">The indices.</param>
        public GlyphsContent(GlyphIndexPoint[] indices)
        {
            this.Indices = indices;
            this.WordCount = indices.Count(p => p.IsSpaceCharacter);
        }

         /// <summary>
        /// Gets or sets the glyph index points.
        /// </summary>
        /// <value>The indices.</value>
        public GlyphIndexPoint[] Indices { get; private set; }
        /// <summary>
        /// Gets or sets the word count.
        /// </summary>
        /// <value>The word count.</value>
        public int WordCount { get; private set; }
        /// <summary>
        /// Gets the character count.
        /// </summary>
        /// <value>The character count.</value>
        public int CharacterCount
        {
            get { return this.Indices.Length; }
        }
    }
}
